using M0;
using Unity.VisualScripting;
using UnityEditor;
using UnityEngine;

public class 对话管理器 : BaseSingleMono<对话管理器>
{
    [SerializeField]private 对话场景 场景;
    
    [ContextMenu("加载对话场景")]
    public void Editor加载对话场景()
    {
        string path = "Assets/Plugins/MoProject/Scripts/第三层/对话系统/对话.prefab";
        var obj = UnityEditor.AssetDatabase.LoadAssetAtPath<对话场景>(path);
        // 场景 = GameObject.Instantiate(obj, transform);
        var objPrefab = PrefabUtility.InstantiatePrefab(obj, transform);
        场景 = objPrefab.GetComponent<对话场景>();
    }

    public void SetUp(string 哪边, (bool, bool) 说话者, 对话Setup所需 左, 对话Setup所需 右)
    {
        场景.SetUp(哪边,说话者,左,右);
    }

    public void 开启对白()
    {
        场景.开始对白();
    }
    public void 关闭对话()
    {
        场景.结束对白();
    }

    public void Set表情(string s, bool left)
    {
        场景.Set表情(s,left);
    }
}
